import { BasicColumn, FormSchema } from "/@/components/Table"

export const columns: BasicColumn[] = [
  {
    title: "模板名称",
    dataIndex: "name",
    width: 150,
    align: "left",
  },
  {
    title: "模板组",
    dataIndex: "groupName",
    width: 100,
  },
  {
    title: "文件名称",
    dataIndex: "fileName",
    align: "left",
    width: 300,
  },
]

export const searchFormSchema: FormSchema[] = [
  {
    field: "groupId",
    label: "模板组",
    component: "Select",
    colProps: { span: 8 },
    componentProps: () => {
      return {
        showSearch: true,
        options: [],
      }
    },
  },
  {
    field: "name",
    label: "模板名称",
    component: "Input",
    colProps: { span: 8 },
  },
]

export const formSchema: FormSchema[] = [
  {
    field: "id",
    label: "id",
    component: "Input",
    show: false,
  },
  {
    field: "name",
    colProps: { span: 12 },
    label: "模板名称",
    component: "Input",
    required: true,
  },
  {
    field: "groupId",
    label: "模板组",
    component: "Select",
    colProps: { span: 12 },
    componentProps: () => {
      return {
        options: [],
      }
    },
  },
  {
    field: "folder",
    label: "文件目录",
    colProps: { span: 12 },
    helpMessage: "为空则是模板名",
    required: false,
    component: "Input",
  },
  {
    field: "fileName",
    colProps: { span: 12 },
    label: "文件名称",
    helpMessage: "可使用velocity变量",
    required: true,
    component: "Input",
  },

  // {
  //   field: 'content',
  //   label: '模板内容',
  //   // labelWidth: "auto",
  //   colProps: { span: 24},
  //   required: true,
  //   component: 'Input',
  //   slot: 'content',
  // }
]

export const copyFormSchema: FormSchema[] = [
  {
    field: "id",
    label: "id",
    component: "Input",
    show: false,
  },
  {
    field: "name",
    label: "模板名称",
    component: "Input",
    required: true,
  },
  {
    field: "groupId",
    label: "模板组",
    component: "Select",
    required: true,
    componentProps: () => {
      return {
        options: [],
      }
    },
  },
]
